package com.computer.demo.service.impl;

import com.computer.demo.service.IQueryService;
import com.computer.spring.framework.annotation.BYService;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @Description
 * @Author MagicIce
 * @Date 2020/11/23 9:04
 */
@BYService
public class QueryService implements IQueryService {
    @Override
    public String query(String name) {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime localDateTime = LocalDateTime.now();
        String json = "{name:\"" + name + "\",time:\"" + formatter.format(localDateTime) + "\"}";
        return json;
    }
}
